%
% Status : main Dynare file
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

if isoctave || matlab_ver_less_than('8.6')
    clear all
else
    clearvars -global
    clear_persistent_variables(fileparts(which('dynare')), false)
end
tic0 = tic;
% Define global variables.
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_
options_ = [];
M_.fname = 'model_5_IRFs';
M_.dynare_version = '5.4';
oo_.dynare_version = '5.4';
options_.dynare_version = '5.4';
%
% Some global variables initialization
%
global_initialization;
M_.exo_names = cell(4,1);
M_.exo_names_tex = cell(4,1);
M_.exo_names_long = cell(4,1);
M_.exo_names(1) = {'e_CREDIT'};
M_.exo_names_tex(1) = {'e\_CREDIT'};
M_.exo_names_long(1) = {'e_CREDIT'};
M_.exo_names(2) = {'e_A'};
M_.exo_names_tex(2) = {'e\_A'};
M_.exo_names_long(2) = {'e_A'};
M_.exo_names(3) = {'e_Mu'};
M_.exo_names_tex(3) = {'e\_Mu'};
M_.exo_names_long(3) = {'e_Mu'};
M_.exo_names(4) = {'e_G'};
M_.exo_names_tex(4) = {'e\_G'};
M_.exo_names_long(4) = {'e_G'};
M_.endo_names = cell(46,1);
M_.endo_names_tex = cell(46,1);
M_.endo_names_long = cell(46,1);
M_.endo_names(1) = {'G_output'};
M_.endo_names_tex(1) = {'G\_output'};
M_.endo_names_long(1) = {'G_output'};
M_.endo_names(2) = {'G_C'};
M_.endo_names_tex(2) = {'G\_C'};
M_.endo_names_long(2) = {'G_C'};
M_.endo_names(3) = {'G_INV'};
M_.endo_names_tex(3) = {'G\_INV'};
M_.endo_names_long(3) = {'G_INV'};
M_.endo_names(4) = {'G_H'};
M_.endo_names_tex(4) = {'G\_H'};
M_.endo_names_long(4) = {'G_H'};
M_.endo_names(5) = {'G_TFP'};
M_.endo_names_tex(5) = {'G\_TFP'};
M_.endo_names_long(5) = {'G_TFP'};
M_.endo_names(6) = {'G_R_ratio'};
M_.endo_names_tex(6) = {'G\_R\_ratio'};
M_.endo_names_long(6) = {'G_R_ratio'};
M_.endo_names(7) = {'G_P_share'};
M_.endo_names_tex(7) = {'G\_P\_share'};
M_.endo_names_long(7) = {'G_P_share'};
M_.endo_names(8) = {'G_pi'};
M_.endo_names_tex(8) = {'G\_pi'};
M_.endo_names_long(8) = {'G_pi'};
M_.endo_names(9) = {'ALPHA_0'};
M_.endo_names_tex(9) = {'ALPHA\_0'};
M_.endo_names_long(9) = {'ALPHA_0'};
M_.endo_names(10) = {'G_prod_disp'};
M_.endo_names_tex(10) = {'G\_prod\_disp'};
M_.endo_names_long(10) = {'G_prod_disp'};
M_.endo_names(11) = {'G_DM_price'};
M_.endo_names_tex(11) = {'G\_DM\_price'};
M_.endo_names_long(11) = {'G_DM_price'};
M_.endo_names(12) = {'G_w'};
M_.endo_names_tex(12) = {'G\_w'};
M_.endo_names_long(12) = {'G_w'};
M_.endo_names(13) = {'G_Z'};
M_.endo_names_tex(13) = {'G\_Z'};
M_.endo_names_long(13) = {'G_Z'};
M_.endo_names(14) = {'G_iota'};
M_.endo_names_tex(14) = {'G\_iota'};
M_.endo_names_long(14) = {'G_iota'};
M_.endo_names(15) = {'G_prod'};
M_.endo_names_tex(15) = {'G\_prod'};
M_.endo_names_long(15) = {'G_prod'};
M_.endo_names(16) = {'B'};
M_.endo_names_tex(16) = {'B'};
M_.endo_names_long(16) = {'B'};
M_.endo_names(17) = {'K_bar'};
M_.endo_names_tex(17) = {'K\_bar'};
M_.endo_names_long(17) = {'K_bar'};
M_.endo_names(18) = {'c_star'};
M_.endo_names_tex(18) = {'c\_star'};
M_.endo_names_long(18) = {'c_star'};
M_.endo_names(19) = {'INV'};
M_.endo_names_tex(19) = {'INV'};
M_.endo_names_long(19) = {'INV'};
M_.endo_names(20) = {'Y'};
M_.endo_names_tex(20) = {'Y'};
M_.endo_names_long(20) = {'Y'};
M_.endo_names(21) = {'IM'};
M_.endo_names_tex(21) = {'IM'};
M_.endo_names_long(21) = {'IM'};
M_.endo_names(22) = {'pi'};
M_.endo_names_tex(22) = {'pi'};
M_.endo_names_long(22) = {'pi'};
M_.endo_names(23) = {'R_ratio'};
M_.endo_names_tex(23) = {'R\_ratio'};
M_.endo_names_long(23) = {'R_ratio'};
M_.endo_names(24) = {'P_share'};
M_.endo_names_tex(24) = {'P\_share'};
M_.endo_names_long(24) = {'P_share'};
M_.endo_names(25) = {'Productivity'};
M_.endo_names_tex(25) = {'Productivity'};
M_.endo_names_long(25) = {'Productivity'};
M_.endo_names(26) = {'TFP'};
M_.endo_names_tex(26) = {'TFP'};
M_.endo_names_long(26) = {'TFP'};
M_.endo_names(27) = {'K'};
M_.endo_names_tex(27) = {'K'};
M_.endo_names_long(27) = {'K'};
M_.endo_names(28) = {'Z'};
M_.endo_names_tex(28) = {'Z'};
M_.endo_names_long(28) = {'Z'};
M_.endo_names(29) = {'H'};
M_.endo_names_tex(29) = {'H'};
M_.endo_names_long(29) = {'H'};
M_.endo_names(30) = {'E_a'};
M_.endo_names_tex(30) = {'E\_a'};
M_.endo_names_long(30) = {'E_a'};
M_.endo_names(31) = {'E_p'};
M_.endo_names_tex(31) = {'E\_p'};
M_.endo_names_long(31) = {'E_p'};
M_.endo_names(32) = {'w'};
M_.endo_names_tex(32) = {'w'};
M_.endo_names_long(32) = {'w'};
M_.endo_names(33) = {'r'};
M_.endo_names_tex(33) = {'r'};
M_.endo_names_long(33) = {'r'};
M_.endo_names(34) = {'iota'};
M_.endo_names_tex(34) = {'iota'};
M_.endo_names_long(34) = {'iota'};
M_.endo_names(35) = {'q_capital'};
M_.endo_names_tex(35) = {'q\_capital'};
M_.endo_names_long(35) = {'q_capital'};
M_.endo_names(36) = {'q_money'};
M_.endo_names_tex(36) = {'q\_money'};
M_.endo_names_long(36) = {'q_money'};
M_.endo_names(37) = {'q_profit'};
M_.endo_names_tex(37) = {'q\_profit'};
M_.endo_names_long(37) = {'q_profit'};
M_.endo_names(38) = {'q_liq'};
M_.endo_names_tex(38) = {'q\_liq'};
M_.endo_names_long(38) = {'q_liq'};
M_.endo_names(39) = {'L'};
M_.endo_names_tex(39) = {'L'};
M_.endo_names_long(39) = {'L'};
M_.endo_names(40) = {'surplus_net'};
M_.endo_names_tex(40) = {'surplus\_net'};
M_.endo_names_long(40) = {'surplus_net'};
M_.endo_names(41) = {'DM_price'};
M_.endo_names_tex(41) = {'DM\_price'};
M_.endo_names_long(41) = {'DM_price'};
M_.endo_names(42) = {'prod_disp'};
M_.endo_names_tex(42) = {'prod\_disp'};
M_.endo_names_long(42) = {'prod_disp'};
M_.endo_names(43) = {'Chi_q'};
M_.endo_names_tex(43) = {'Chi\_q'};
M_.endo_names_long(43) = {'Chi_q'};
M_.endo_names(44) = {'Mu'};
M_.endo_names_tex(44) = {'Mu'};
M_.endo_names_long(44) = {'Mu'};
M_.endo_names(45) = {'G'};
M_.endo_names_tex(45) = {'G'};
M_.endo_names_long(45) = {'G'};
M_.endo_names(46) = {'A'};
M_.endo_names_tex(46) = {'A'};
M_.endo_names_long(46) = {'A'};
M_.endo_partitions = struct();
M_.param_names = cell(53,1);
M_.param_names_tex = cell(53,1);
M_.param_names_long = cell(53,1);
M_.param_names(1) = {'BETA'};
M_.param_names_tex(1) = {'BETA'};
M_.param_names_long(1) = {'BETA'};
M_.param_names(2) = {'SIGMA'};
M_.param_names_tex(2) = {'SIGMA'};
M_.param_names_long(2) = {'SIGMA'};
M_.param_names(3) = {'ETA'};
M_.param_names_tex(3) = {'ETA'};
M_.param_names_long(3) = {'ETA'};
M_.param_names(4) = {'tau_k'};
M_.param_names_tex(4) = {'tau\_k'};
M_.param_names_long(4) = {'tau_k'};
M_.param_names(5) = {'tau_h'};
M_.param_names_tex(5) = {'tau\_h'};
M_.param_names_long(5) = {'tau_h'};
M_.param_names(6) = {'XI'};
M_.param_names_tex(6) = {'XI'};
M_.param_names_long(6) = {'XI'};
M_.param_names(7) = {'MU'};
M_.param_names_tex(7) = {'MU'};
M_.param_names_long(7) = {'MU'};
M_.param_names(8) = {'DELTA'};
M_.param_names_tex(8) = {'DELTA'};
M_.param_names_long(8) = {'DELTA'};
M_.param_names(9) = {'THETA'};
M_.param_names_tex(9) = {'THETA'};
M_.param_names_long(9) = {'THETA'};
M_.param_names(10) = {'ALPHA'};
M_.param_names_tex(10) = {'ALPHA'};
M_.param_names_long(10) = {'ALPHA'};
M_.param_names(11) = {'CHI_q'};
M_.param_names_tex(11) = {'CHI\_q'};
M_.param_names_long(11) = {'CHI_q'};
M_.param_names(12) = {'CHI_k'};
M_.param_names_tex(12) = {'CHI\_k'};
M_.param_names_long(12) = {'CHI_k'};
M_.param_names(13) = {'CHI_PI'};
M_.param_names_tex(13) = {'CHI\_PI'};
M_.param_names_long(13) = {'CHI_PI'};
M_.param_names(14) = {'CHI_PI_k'};
M_.param_names_tex(14) = {'CHI\_PI\_k'};
M_.param_names_long(14) = {'CHI_PI_k'};
M_.param_names(15) = {'ZETA'};
M_.param_names_tex(15) = {'ZETA'};
M_.param_names_long(15) = {'ZETA'};
M_.param_names(16) = {'EPS_L_BOUND'};
M_.param_names_tex(16) = {'EPS\_L\_BOUND'};
M_.param_names_long(16) = {'EPS_L_BOUND'};
M_.param_names(17) = {'EPS_H_BOUND'};
M_.param_names_tex(17) = {'EPS\_H\_BOUND'};
M_.param_names_long(17) = {'EPS_H_BOUND'};
M_.param_names(18) = {'S_PARAM'};
M_.param_names_tex(18) = {'S\_PARAM'};
M_.param_names_long(18) = {'S_PARAM'};
M_.param_names(19) = {'M_PARAM'};
M_.param_names_tex(19) = {'M\_PARAM'};
M_.param_names_long(19) = {'M_PARAM'};
M_.param_names(20) = {'c_mu'};
M_.param_names_tex(20) = {'c\_mu'};
M_.param_names_long(20) = {'c_mu'};
M_.param_names(21) = {'c_sig'};
M_.param_names_tex(21) = {'c\_sig'};
M_.param_names_long(21) = {'c_sig'};
M_.param_names(22) = {'RHO_CREDIT'};
M_.param_names_tex(22) = {'RHO\_CREDIT'};
M_.param_names_long(22) = {'RHO_CREDIT'};
M_.param_names(23) = {'RHO_A'};
M_.param_names_tex(23) = {'RHO\_A'};
M_.param_names_long(23) = {'RHO_A'};
M_.param_names(24) = {'RHO_MU'};
M_.param_names_tex(24) = {'RHO\_MU'};
M_.param_names_long(24) = {'RHO_MU'};
M_.param_names(25) = {'RHO_G'};
M_.param_names_tex(25) = {'RHO\_G'};
M_.param_names_long(25) = {'RHO_G'};
M_.param_names(26) = {'SIGMA_CREDIT'};
M_.param_names_tex(26) = {'SIGMA\_CREDIT'};
M_.param_names_long(26) = {'SIGMA_CREDIT'};
M_.param_names(27) = {'SIGMA_A'};
M_.param_names_tex(27) = {'SIGMA\_A'};
M_.param_names_long(27) = {'SIGMA_A'};
M_.param_names(28) = {'SIGMA_MU'};
M_.param_names_tex(28) = {'SIGMA\_MU'};
M_.param_names_long(28) = {'SIGMA_MU'};
M_.param_names(29) = {'SIGMA_G'};
M_.param_names_tex(29) = {'SIGMA\_G'};
M_.param_names_long(29) = {'SIGMA_G'};
M_.param_names(30) = {'B_SS'};
M_.param_names_tex(30) = {'B\_SS'};
M_.param_names_long(30) = {'B_SS'};
M_.param_names(31) = {'W_SS'};
M_.param_names_tex(31) = {'W\_SS'};
M_.param_names_long(31) = {'W_SS'};
M_.param_names(32) = {'K_BAR_SS'};
M_.param_names_tex(32) = {'K\_BAR\_SS'};
M_.param_names_long(32) = {'K_BAR_SS'};
M_.param_names(33) = {'C_STAR_SS'};
M_.param_names_tex(33) = {'C\_STAR\_SS'};
M_.param_names_long(33) = {'C_STAR_SS'};
M_.param_names(34) = {'G_SS'};
M_.param_names_tex(34) = {'G\_SS'};
M_.param_names_long(34) = {'G_SS'};
M_.param_names(35) = {'A_SS'};
M_.param_names_tex(35) = {'A\_SS'};
M_.param_names_long(35) = {'A_SS'};
M_.param_names(36) = {'ALPHA_0_SS'};
M_.param_names_tex(36) = {'ALPHA\_0\_SS'};
M_.param_names_long(36) = {'ALPHA_0_SS'};
M_.param_names(37) = {'DM_price_SS'};
M_.param_names_tex(37) = {'DM\_price\_SS'};
M_.param_names_long(37) = {'DM_price_SS'};
M_.param_names(38) = {'prod_disp_SS'};
M_.param_names_tex(38) = {'prod\_disp\_SS'};
M_.param_names_long(38) = {'prod_disp_SS'};
M_.param_names(39) = {'E_a_SS'};
M_.param_names_tex(39) = {'E\_a\_SS'};
M_.param_names_long(39) = {'E_a_SS'};
M_.param_names(40) = {'E_p_SS'};
M_.param_names_tex(40) = {'E\_p\_SS'};
M_.param_names_long(40) = {'E_p_SS'};
M_.param_names(41) = {'R_ratio_SS'};
M_.param_names_tex(41) = {'R\_ratio\_SS'};
M_.param_names_long(41) = {'R_ratio_SS'};
M_.param_names(42) = {'P_share_SS'};
M_.param_names_tex(42) = {'P\_share\_SS'};
M_.param_names_long(42) = {'P_share_SS'};
M_.param_names(43) = {'Y_SS'};
M_.param_names_tex(43) = {'Y\_SS'};
M_.param_names_long(43) = {'Y_SS'};
M_.param_names(44) = {'K_SS'};
M_.param_names_tex(44) = {'K\_SS'};
M_.param_names_long(44) = {'K_SS'};
M_.param_names(45) = {'Z_SS'};
M_.param_names_tex(45) = {'Z\_SS'};
M_.param_names_long(45) = {'Z_SS'};
M_.param_names(46) = {'L_SS'};
M_.param_names_tex(46) = {'L\_SS'};
M_.param_names_long(46) = {'L_SS'};
M_.param_names(47) = {'q_capital_SS'};
M_.param_names_tex(47) = {'q\_capital\_SS'};
M_.param_names_long(47) = {'q_capital_SS'};
M_.param_names(48) = {'q_money_SS'};
M_.param_names_tex(48) = {'q\_money\_SS'};
M_.param_names_long(48) = {'q_money_SS'};
M_.param_names(49) = {'q_profit_SS'};
M_.param_names_tex(49) = {'q\_profit\_SS'};
M_.param_names_long(49) = {'q_profit_SS'};
M_.param_names(50) = {'q_liq_SS'};
M_.param_names_tex(50) = {'q\_liq\_SS'};
M_.param_names_long(50) = {'q_liq_SS'};
M_.param_names(51) = {'surplus_SS'};
M_.param_names_tex(51) = {'surplus\_SS'};
M_.param_names_long(51) = {'surplus_SS'};
M_.param_names(52) = {'q_average_prod'};
M_.param_names_tex(52) = {'q\_average\_prod'};
M_.param_names_long(52) = {'q_average_prod'};
M_.param_names(53) = {'a'};
M_.param_names_tex(53) = {'a'};
M_.param_names_long(53) = {'a'};
M_.param_partitions = struct();
M_.exo_det_nbr = 0;
M_.exo_nbr = 4;
M_.endo_nbr = 46;
M_.param_nbr = 53;
M_.orig_endo_nbr = 46;
M_.aux_vars = [];
M_ = setup_solvers(M_);
M_.Sigma_e = zeros(4, 4);
M_.Correlation_matrix = eye(4, 4);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = true;
M_.det_shocks = [];
M_.surprise_shocks = [];
M_.heteroskedastic_shocks.Qvalue_orig = [];
M_.heteroskedastic_shocks.Qscale_orig = [];
options_.linear = false;
options_.block = false;
options_.bytecode = false;
options_.use_dll = false;
M_.orig_eq_nbr = 46;
M_.eq_nbr = 46;
M_.ramsey_eq_nbr = 0;
M_.set_auxiliary_variables = exist(['./+' M_.fname '/set_auxiliary_variables.m'], 'file') == 2;
M_.epilogue_names = {};
M_.epilogue_var_list_ = {};
M_.orig_maximum_endo_lag = 1;
M_.orig_maximum_endo_lead = 1;
M_.orig_maximum_exo_lag = 0;
M_.orig_maximum_exo_lead = 0;
M_.orig_maximum_exo_det_lag = 0;
M_.orig_maximum_exo_det_lead = 0;
M_.orig_maximum_lag = 1;
M_.orig_maximum_lead = 1;
M_.orig_maximum_lag_with_diffs_expanded = 1;
M_.lead_lag_incidence = [
 0 6 0;
 0 7 0;
 0 8 0;
 0 9 0;
 0 10 0;
 0 11 0;
 0 12 0;
 0 13 0;
 0 14 52;
 0 15 0;
 0 16 0;
 0 17 0;
 0 18 0;
 0 19 0;
 0 20 0;
 0 21 53;
 0 22 0;
 0 23 0;
 0 24 0;
 0 25 0;
 0 26 0;
 0 27 0;
 0 28 0;
 0 29 0;
 0 30 0;
 0 31 0;
 1 32 0;
 0 33 0;
 0 34 0;
 0 35 0;
 0 36 0;
 0 37 54;
 0 38 0;
 0 39 0;
 0 40 55;
 0 41 56;
 0 42 57;
 0 43 0;
 0 44 0;
 0 45 0;
 0 46 0;
 0 47 0;
 2 48 0;
 3 49 0;
 4 50 0;
 5 51 0;]';
M_.nstatic = 35;
M_.nfwrd   = 6;
M_.npred   = 5;
M_.nboth   = 0;
M_.nsfwrd   = 6;
M_.nspred   = 5;
M_.ndynamic   = 11;
M_.dynamic_tmp_nbr = [20; 28; 0; 0; ];
M_.model_local_variables_dynamic_tt_idxs = {
};
M_.equations_tags = {
  1 , 'name' , 'q_capital' ;
  2 , 'name' , 'q_profit' ;
  3 , 'name' , 'q_money' ;
  4 , 'name' , 'q_liq' ;
  5 , 'name' , '5' ;
  6 , 'name' , 'Z' ;
  7 , 'name' , 'w' ;
  8 , 'name' , '8' ;
  9 , 'name' , '9' ;
  10 , 'name' , 'ALPHA_0' ;
  11 , 'name' , 'IM' ;
  12 , 'name' , 'pi' ;
  13 , 'name' , 'r' ;
  14 , 'name' , 'iota' ;
  15 , 'name' , '15' ;
  16 , 'name' , 'E_p' ;
  17 , 'name' , 'E_a' ;
  18 , 'name' , '18' ;
  19 , 'name' , '19' ;
  20 , 'name' , 'K_bar' ;
  21 , 'name' , 'Y' ;
  22 , 'name' , '22' ;
  23 , 'name' , 'INV' ;
  24 , 'name' , 'H' ;
  25 , 'name' , '25' ;
  26 , 'name' , 'TFP' ;
  27 , 'name' , 'DM_price' ;
  28 , 'name' , 'prod_disp' ;
  29 , 'name' , 'G_w' ;
  30 , 'name' , 'G_pi' ;
  31 , 'name' , 'G_iota' ;
  32 , 'name' , 'G_R_ratio' ;
  33 , 'name' , 'G_P_share' ;
  34 , 'name' , 'G_prod' ;
  35 , 'name' , 'G_TFP' ;
  36 , 'name' , 'G_Z' ;
  37 , 'name' , 'G_output' ;
  38 , 'name' , 'G_INV' ;
  39 , 'name' , 'G_C' ;
  40 , 'name' , 'G_H' ;
  41 , 'name' , 'G_DM_price' ;
  42 , 'name' , 'G_prod_disp' ;
  43 , 'name' , '43' ;
  44 , 'name' , '44' ;
  45 , 'name' , '45' ;
  46 , 'name' , '46' ;
};
M_.mapping.G_output.eqidx = [37 ];
M_.mapping.G_C.eqidx = [39 ];
M_.mapping.G_INV.eqidx = [38 ];
M_.mapping.G_H.eqidx = [40 ];
M_.mapping.G_TFP.eqidx = [35 ];
M_.mapping.G_R_ratio.eqidx = [32 ];
M_.mapping.G_P_share.eqidx = [33 ];
M_.mapping.G_pi.eqidx = [30 ];
M_.mapping.ALPHA_0.eqidx = [5 10 16 17 20 28 ];
M_.mapping.G_prod_disp.eqidx = [42 ];
M_.mapping.G_DM_price.eqidx = [41 ];
M_.mapping.G_w.eqidx = [29 ];
M_.mapping.G_Z.eqidx = [36 ];
M_.mapping.G_iota.eqidx = [31 ];
M_.mapping.G_prod.eqidx = [34 ];
M_.mapping.B.eqidx = [2 3 4 5 7 9 15 16 17 22 27 28 ];
M_.mapping.K_bar.eqidx = [20 22 24 ];
M_.mapping.c_star.eqidx = [8 21 39 ];
M_.mapping.INV.eqidx = [18 23 38 ];
M_.mapping.Y.eqidx = [21 22 25 37 ];
M_.mapping.IM.eqidx = [11 37 39 40 ];
M_.mapping.pi.eqidx = [12 14 30 ];
M_.mapping.R_ratio.eqidx = [18 32 ];
M_.mapping.P_share.eqidx = [19 33 ];
M_.mapping.Productivity.eqidx = [25 26 34 ];
M_.mapping.TFP.eqidx = [26 35 ];
M_.mapping.K.eqidx = [9 16 17 20 21 23 25 ];
M_.mapping.Z.eqidx = [6 ];
M_.mapping.H.eqidx = [24 25 40 ];
M_.mapping.E_a.eqidx = [17 18 19 ];
M_.mapping.E_p.eqidx = [16 18 19 ];
M_.mapping.w.eqidx = [5 7 8 9 24 29 37 39 ];
M_.mapping.r.eqidx = [13 14 ];
M_.mapping.iota.eqidx = [14 31 ];
M_.mapping.q_capital.eqidx = [1 5 20 ];
M_.mapping.q_money.eqidx = [3 5 ];
M_.mapping.q_profit.eqidx = [2 5 ];
M_.mapping.q_liq.eqidx = [4 20 ];
M_.mapping.L.eqidx = [1 2 3 4 15 16 17 27 28 ];
M_.mapping.surplus_net.eqidx = [9 10 11 ];
M_.mapping.DM_price.eqidx = [27 41 ];
M_.mapping.prod_disp.eqidx = [28 42 ];
M_.mapping.Chi_q.eqidx = [2 3 4 9 15 16 17 27 28 43 ];
M_.mapping.Mu.eqidx = [12 44 ];
M_.mapping.G.eqidx = [21 37 46 ];
M_.mapping.A.eqidx = [7 24 25 26 45 ];
M_.mapping.e_CREDIT.eqidx = [43 ];
M_.mapping.e_A.eqidx = [45 ];
M_.mapping.e_Mu.eqidx = [44 ];
M_.mapping.e_G.eqidx = [46 ];
M_.static_and_dynamic_models_differ = false;
M_.has_external_function = true;
M_.state_var = [27 43 44 45 46 ];
M_.exo_names_orig_ord = [1:4];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(46, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(4, 1);
M_.params = NaN(53, 1);
M_.endo_trends = struct('deflator', cell(46, 1), 'log_deflator', cell(46, 1), 'growth_factor', cell(46, 1), 'log_growth_factor', cell(46, 1));
M_.NNZDerivatives = [146; -1; -1; ];
M_.static_tmp_nbr = [20; 29; 0; 0; ];
M_.model_local_variables_static_tt_idxs = {
};
load params;
set_param_value('BETA'          ,par.BETA);
set_param_value('SIGMA'         ,par.SIGMA);
set_param_value('ETA'           ,par.ETA);
set_param_value('G_SS'          ,par.G);
set_param_value('tau_k'         ,par.tau_k);
set_param_value('tau_h'         ,par.tau_h);
set_param_value('XI'            ,par.XI);
set_param_value('A_SS'          ,par.A);
set_param_value('MU'            ,par.MU);
set_param_value('DELTA'         ,par.DELTA);
set_param_value('THETA'         ,par.THETA);
set_param_value('ALPHA'         ,par.ALPHA);
set_param_value('c_mu'          ,par.c_mu);
set_param_value('c_sig'         ,par.c_sig);
set_param_value('surplus_SS'    ,par.surplus_SS);
set_param_value('CHI_q'         ,par.CHI_q);
set_param_value('CHI_k'         ,par.CHI_k);
set_param_value('CHI_PI'        ,par.CHI_PI);
set_param_value('CHI_PI_k'      ,par.CHI_PI_k);
set_param_value('EPS_L_BOUND'   ,par.EPS_L_BOUND);
set_param_value('EPS_H_BOUND'   ,par.EPS_H_BOUND);
set_param_value('S_PARAM'       ,par.S_PARAM);
set_param_value('M_PARAM'       ,par.M_PARAM);
set_param_value('ZETA'          ,par.ZETA);
set_param_value('B_SS'          ,par.B_SS);
set_param_value('L_SS'          ,par.L_SS);
set_param_value('W_SS'          ,par.W_SS);
set_param_value('K_BAR_SS'      ,par.K_BAR_SS);
set_param_value('C_STAR_SS'     ,par.C_STAR_SS);
set_param_value('DM_price_SS'   ,par.DM_price_SS);
set_param_value('prod_disp_SS'  ,par.prod_disp_SS);
set_param_value('ALPHA_0_SS'    ,par.ALPHA_0_SS);
set_param_value('E_a_SS'        ,par.E_a_SS);
set_param_value('E_p_SS'        ,par.E_p_SS);
set_param_value('R_ratio_SS'    ,par.R_ratio_SS);
set_param_value('P_share_SS'    ,par.P_share_SS);
set_param_value('Y_SS'          ,par.Y_SS);
set_param_value('K_SS'          ,par.K_SS);
set_param_value('Z_SS'          ,par.Z_SS);
set_param_value('q_capital_SS'        ,par.q_capital_SS);
set_param_value('q_money_SS'          ,par.q_money_SS);
set_param_value('q_profit_SS'         ,par.q_profit_SS);
set_param_value('q_liq_SS'            ,par.q_liq_SS);
set_param_value('q_average_prod'      ,par.q_average_prod);
set_param_value('a'                   ,par.a);
set_param_value('RHO_CREDIT'     ,par.RHO_CREDIT);
set_param_value('RHO_A'          ,par.RHO_A);
set_param_value('RHO_MU'         ,par.RHO_MU);
set_param_value('RHO_G'          ,par.RHO_G);
set_param_value('SIGMA_CREDIT'   ,par.SIGMA_CREDIT);
set_param_value('SIGMA_A'        ,par.SIGMA_A);
set_param_value('SIGMA_MU'       ,par.SIGMA_MU);
set_param_value('SIGMA_G'        ,par.SIGMA_G);
%
% INITVAL instructions
%
options_.initval_file = false;
oo_.steady_state(9) = M_.params(36);
oo_.steady_state(46) = M_.params(35);
oo_.steady_state(45) = M_.params(34);
oo_.steady_state(27) = M_.params(44);
oo_.steady_state(28) = M_.params(45);
oo_.steady_state(36) = M_.params(48);
oo_.steady_state(35) = M_.params(47);
oo_.steady_state(37) = M_.params(49);
oo_.steady_state(38) = M_.params(50);
oo_.steady_state(40) = M_.params(51);
oo_.steady_state(16) = M_.params(30);
oo_.steady_state(32) = M_.params(31);
oo_.steady_state(19) = M_.params(8)*oo_.steady_state(27);
oo_.steady_state(17) = M_.params(32);
oo_.steady_state(18) = M_.params(33);
oo_.steady_state(20) = M_.params(43);
oo_.steady_state(29) = (oo_.steady_state(20)/oo_.steady_state(46)/oo_.steady_state(17)^(1-M_.params(3)))^(1/M_.params(3));
oo_.steady_state(39) = M_.params(46);
oo_.steady_state(30) = M_.params(39);
oo_.steady_state(31) = M_.params(40);
oo_.steady_state(23) = (M_.params(39)+M_.params(40))/(M_.params(39)+M_.params(40)+oo_.steady_state(19));
oo_.steady_state(24) = M_.params(40)/(M_.params(39)+M_.params(40));
oo_.steady_state(43) = M_.params(11);
oo_.steady_state(44) = M_.params(7);
oo_.steady_state(22) = M_.params(7);
oo_.steady_state(33) = 1/M_.params(1)-1;
oo_.steady_state(34) = (1+oo_.steady_state(33))*(1+oo_.steady_state(22))-1;
oo_.steady_state(25) = oo_.steady_state(20)/(oo_.steady_state(46)^(1-M_.params(3))*oo_.steady_state(27)^(1-M_.params(3))*oo_.steady_state(29)^M_.params(3));
oo_.steady_state(26) = oo_.steady_state(46)^(1-M_.params(3))*oo_.steady_state(25);
oo_.steady_state(41) = M_.params(37);
oo_.steady_state(42) = M_.params(38);
oo_.steady_state(21) = average_log_normal(oo_.steady_state(40),M_.params(20),M_.params(21));
if M_.exo_nbr > 0
	oo_.exo_simul = ones(M_.maximum_lag,1)*oo_.exo_steady_state';
end
if M_.exo_det_nbr > 0
	oo_.exo_det_simul = ones(M_.maximum_lag,1)*oo_.exo_det_steady_state';
end
resid;
steady;
%
% SHOCKS instructions
%
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (1)^2;
M_.Sigma_e(2, 2) = (1)^2;
M_.Sigma_e(3, 3) = (1)^2;
M_.Sigma_e(4, 4) = (1)^2;
options_.noprint=1;
options_.bandpass.indicator = true;
options_.contemporaneous_correlation = true;
options_.irf = 20;
options_.nograph = true;
options_.order = 1;
options_.bandpass.passband = [2;9;];
var_list_ = {};
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);


oo_.time = toc(tic0);
disp(['Total computing time : ' dynsec2hms(oo_.time) ]);
if ~exist([M_.dname filesep 'Output'],'dir')
    mkdir(M_.dname,'Output');
end
save([M_.dname filesep 'Output' filesep 'model_5_IRFs_results.mat'], 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'model_5_IRFs_results.mat'], 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'model_5_IRFs_results.mat'], 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'model_5_IRFs_results.mat'], 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'model_5_IRFs_results.mat'], 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'model_5_IRFs_results.mat'], 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'model_5_IRFs_results.mat'], 'oo_recursive_', '-append');
end
if ~isempty(lastwarn)
  disp('Note: warning(s) encountered in MATLAB/Octave code')
end
